package com.aiyige.model.moment.backup;


import java.io.Serializable;

/**
 * 功能: 库存状态. <br/>
 *
 * @author wangzhijun
 * @date 2018-01-15 19:32
 * @since JDK 1.8
 */
public class InventoryBackup implements Serializable {
    /**
     * 总库存
     */
    private Long total;
    /**
     * 订单占用库存
     */
    private Long orderOccupiedInventory;
    /**
     * 锁定库存
     */
    private Long lockedInventory;
    /**
     * 虚拟库存
     */
    private Long virtualInventory;
    /**
     * 可用库存
     */
    private Long availableInventory;

    public InventoryBackup() {
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public Long getOrderOccupiedInventory() {
        return orderOccupiedInventory;
    }

    public void setOrderOccupiedInventory(Long orderOccupiedInventory) {
        this.orderOccupiedInventory = orderOccupiedInventory;
    }

    public Long getLockedInventory() {
        return lockedInventory;
    }

    public void setLockedInventory(Long lockedInventory) {
        this.lockedInventory = lockedInventory;
    }

    public Long getVirtualInventory() {
        return virtualInventory;
    }

    public void setVirtualInventory(Long virtualInventory) {
        this.virtualInventory = virtualInventory;
    }

    public Long getAvailableInventory() {
        return availableInventory;
    }

    public void setAvailableInventory(Long availableInventory) {
        this.availableInventory = availableInventory;
    }

    public InventoryBackup(InventoryBackup other) {
        if (other == null) {
            this.total = 0l;
            this.orderOccupiedInventory = 0l;
            this.lockedInventory = 0l;
            this.virtualInventory = 0l;
            this.availableInventory = 0l;
        } else {
            this.total = other.total == null ? 0l : other.total;
            this.orderOccupiedInventory = other.orderOccupiedInventory == null ? 0l : other.orderOccupiedInventory;
            this.lockedInventory = other.lockedInventory == null ? 0l : other.lockedInventory;
            this.virtualInventory = other.virtualInventory == null ? 0l : other.virtualInventory;
            this.availableInventory = other.availableInventory == null ? 0l : other.availableInventory;
        }
    }
}
